<@t.header>
<link rel="stylesheet" href="${request.contextPath}/app/contract/css/contract-create.css">
</@t.header> <@t.body> <#if invalid?? && invalid>
<div class="alert alert-danger" role="alert">
	<strong>警告！</strong>
	无效的合同信息！
</div>
<#elseif cannotedit?? && cannotedit>
<div class="alert alert-danger" role="alert">
	<strong>警告！</strong>
	您无法编辑该信息！
	<a href="${request.contextPath}/contract/view/${data.id}">返回</a>
</div>
<#elseif errortype?? && errortype>
<div class="alert alert-danger" role="alert">
	<strong>警告！</strong>
	合同类型无效
	<a href="${request.contextPath}/contract/view/${data.id}">返回</a>
</div>
<#else>
<div class="navbar navbar-default navbar-fixed-top padding-0 margin-0">
	<div class="container-fluid">
		<div class="navbar-header">
			<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#suredy-form-navbar">
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
			</button>
			<span class="navbar-brand">
				<i class="icon-paste icon-large"></i>
				编辑${data.type.value}
			</span>
		</div>
		<div class="collapse navbar-collapse" id="suredy-form-navbar">
			<ul class="nav navbar-nav suredy-form-bar">
				<li>
					<a href="javascript:void(0);" class="submit-contract-info">
						<i class="icon-ok icon-large"></i>
						保存
					</a>
				</li>
				<li>
					<a href="javascript:void(0);" class="reset-form-info">
						<i class="icon-undo icon-large"></i>
						重置表单
					</a>
				</li>
				<li>
					<a href="javascript:void(0);" class="back-view" data-id="${data.id}">
						<i class="icon-remove icon-large"></i>
						取消编辑
					</a>
				</li>
			</ul>
		</div>
	</div>
</div>

<div class="container" style="padding-top: 60px;">
	<form class="form-create-contract" action="${request.contextPath}/contract/edit" method="post">
		<input type="hidden" name="id" value="${data.id}" />
		<div class="panel panel-primary">
			<div class="panel-heading">
				<h3 class="panel-title">
					基本信息 <#if 'B_CONTRACT'==data.type>
					<div class="btn btn-xs btn-danger bidding-create pull-right" style="margin-top: -2px;">
						<i class="icon-plus"></i>
						新建设单位
					</div>
					</#if>
				</h3>
			</div>
			<div class="panel-body" style="padding-bottom: 0;">
				<div class="row">
					<div class="col-md-12">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									<div class="form-item-title">
										<span class="not-null-star">*</span>
										合同名称
									</div>
								</div>
								<input type="text" class="form-control not-empty" name="name" value="${data.name}" placeholder="最多100个汉字">
							</div>
						</div>
					</div>
					<div class="col-md-6">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									<div class="form-item-title">
										<span class="not-null-star">*</span>
										建设单位
									</div>
								</div>
								<input type="text" class="form-control not-empty" name="companyA" value="${data.companyA}" readonly="readonly">
							</div>
						</div>
					</div>
					<div class="col-md-6">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									<div class="form-item-title">
										<span class="not-null-star">*</span>
										承建单位
									</div>
								</div>
								<input type="text" class="form-control not-empty" name="companyB" value="${data.companyB}" readonly="readonly">
							</div>
						</div>
					</div>
					<div class="col-md-6">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									<div class="form-item-title">
										<span class="not-null-star">*</span>
										合同编号
									</div>
								</div>
								<input type="text" class="form-control not-empty" name="no" value="${data.no}" placeholder="最多50个字符">
							</div>
						</div>
					</div>
					<div class="col-md-6">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									<div class="form-item-title">
										<span class="not-null-star">*</span>
										合同金额
									</div>
								</div>
								<input type="text" class="form-control not-empty number" name="price" value="${data.price}" placeholder="只能是数字">
							</div>
						</div>
					</div>
					<div class="col-md-6">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									<div class="form-item-title">
										<span class="not-null-star">*</span>
										签订日期
									</div>
								</div>
								<input type="text" class="form-control not-empty datetimepicker" name="signDate" data-foot="false" data-format="yyyy-MM-dd" value="${(data.signDate?string('yyyy-MM-dd'))!''}" readonly="readonly">
							</div>
						</div>
					</div>
					<div class="col-md-6">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									<div class="form-item-title">
										<span class="not-null-star">*</span>
										办结日期
									</div>
								</div>
								<input type="text" class="form-control not-empty datetimepicker" name="bjTime" data-foot="false" data-format="yyyy-MM-dd" value="${(data.bjTime?string('yyyy-MM-dd'))!''}" readonly="readonly" placeholder="请选择日期">
							</div>
						</div>
					</div>
					<div class="col-md-12">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									<div class="form-item-title">
										<span class="not-null-star">*</span>
										合同工期
										<small class="text-danger contract-days-helper" style="font-weight: bold; cursor: pointer;">？</small>
									</div>
								</div>
								<input type="text" class="form-control datetimepicker" name="contractStart" value="${(data.contractStart)!''}" data-foot="false" data-format="yyyy-MM-dd" readonly="readonly" placeholder="开工日期">
								<div class="input-group-addon" style="border-left: none; border-right: none;">
									至
								</div>
								<input type="text" class="form-control datetimepicker" name="contractEnd" value="${(data.contractEnd)!''}" data-foot="false" data-format="yyyy-MM-dd" readonly="readonly" placeholder="竣工日期">
								<div class="input-group-addon" style="border-left: none; border-right: none;">
									工期天数
								</div>
								<input type="text" class="form-control number" name="contractDays" value="${data.contractDays}" placeholder="工期天数">
								<div class="input-group-addon" style="border-left: none;">
									天
								</div>
							</div>
						</div>
					</div>
					<div class="col-md-12">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									<div class="form-item-title">
										<span class="not-null-star">*</span>
										结算方式
									</div>
								</div>
								<select class="form-control not-empty" name="jiesuanWay">
									<#if jiesuanWay??> <#list jiesuanWay as jw>
									<option value="${jw}" ${((data.jiesuanWay==jw)?string('selected',''))!''}>${jw}</option>
									</#list> </#if>
								</select>
							</div>
						</div>
					</div>
					<div class="col-md-12">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									<div class="form-item-title">
										<span class="not-null-star">*</span>
										付款方式
									</div>
								</div>
								<textarea rows="3" class="form-control not-empty" name="fukuanWay" placeholder="最多500个汉字">${data.fukuanWay}</textarea>
							</div>
						</div>
					</div>
					<div class="col-md-12">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									<div class="form-item-title">
										<span class="not-null-star">*</span>
										工程内容
									</div>
								</div>
								<textarea rows="3" class="form-control not-empty" name="mainContent" placeholder="最多1000个汉字。">${data.mainContent}</textarea>
							</div>
						</div>
					</div>
					<div class="col-md-12">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									<div class="form-item-title">
										<span class="not-null-star">*</span>
										承包范围
									</div>
								</div>
								<textarea rows="3" class="form-control not-empty" name="chengbaoFanwei" placeholder="最多1000个汉字。">${data.chengbaoFanwei}</textarea>
							</div>
						</div>
					</div>
					<div class="col-md-12">
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									<div class="form-item-title">备注</div>
								</div>
								<textarea rows="3" class="form-control" name="remark" placeholder="最多1000个汉字">${data.remark}</textarea>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

		<hr style="margin-top: 5px;">
	</form>
</div>
</#if> </@t.body> <@t.foot>
<script src="${request.contextPath}/core/js/jquery.form.js"></script>
<script src="${request.contextPath}/js/suredy-modal.js"></script>
<script src="${request.contextPath}/js/suredy-datetimepicker.js"></script>
<script src="${request.contextPath}/app/js/file.js"></script>
<script src="${request.contextPath}/app/flow/js/flow.js"></script>
<script src="${request.contextPath}/app/js/form-checker.js"></script>
<script src="${request.contextPath}/app/contract/js/contract-create.js"></script>
</@t.foot>
